Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POC: Build with FFmpeg n6.1.1 #57

Closed
wants to merge 1 commit into from
Closed

Conversation

Tryanks
Copy link
Contributor

@Tryanks Tryanks commented Mar 29, 2024

In this PR, I made the smallest possible changes to make go-astiav work with FFmpeg n6.1.1. It is merely a proof of concept: for tasks limited to simple encoding, decoding, and filtering, most of the library's code works effectively.

It must be stated that this library is absolutely not ready for merging, nor will it be in the future. There are many breaking changes from FFmpeg 5.x -> 6.x that need to be adapted, such as:

# github.com/asticode/go-astiav
cgo-gcc-prolog: In function ‘_cgo_62ea77cbc7a2_Cfunc_av_stream_get_side_data’:
cgo-gcc-prolog:57:2: warning: ‘av_stream_get_side_data’ is deprecated [-Wdeprecated-declarations]
In file included from /root/go/pkg/mod/github.com/!tryanks/[email protected]/stream.go:4:
/usr/local/include/libavformat/avformat.h:1913:10: note: declared here
 1913 | uint8_t *av_stream_get_side_data(const AVStream *stream,
      |          ^~~~~~~~~~~~~~~~~~~~~~~
cgo-gcc-prolog: In function ‘_cgo_62ea77cbc7a2_Cfunc_av_stream_new_side_data’:
cgo-gcc-prolog:78:2: warning: ‘av_stream_new_side_data’ is deprecated [-Wdeprecated-declarations]
/usr/local/include/libavformat/avformat.h:1898:10: note: declared here
 1898 | uint8_t *av_stream_new_side_data(AVStream *stream,
      |          ^~~~~~~~~~~~~~~~~~~~~~~

And other new APIs, etc.
Another issue that must be considered is that its changes are significant enough to affect any project currently using go-astiav, so it definitely should not be merged.

If this library can be of help to anyone, you could adding the following section in go.mod to use it:

replace github.com/asticode/go-astiav => github.com/Tryanks/go-astiav v0.14.0

But this fork will not receive any maintenance or updates. For anyone interested in using FFmpeg Bindings in Go, the only correct choice is still asticode/go-astiav.
Have fun :)

P.S. I wrote this just to make go-astiav work with ffmpeg-rockchip so that it can utilize the hardware encoder/decoder on my RK3588 board.

EDIT:
Now you could clone Quentin's great branch [bump/n6.1.1] built with FFmpeg n6.1.1 👍.

git clone -b bump/n6.1.1 https://github.com/asticode/go-astiav  /home/user/go-astiav

In your project's go.mod

replace github.com/asticode/go-astiav => /home/user/go-astiav

@asticode
Copy link
Owner

First off thanks for the PR 👍

However, I've had for quite some time a local branch with unfinished changes to bump to n6.0. Your PR reminded me I had to finish it and that's what I did: it's available on the branch called bump/n6.1.1

If you don't mind I'll close this PR, but I'd be happy to have your feedback on the content of this new branch 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants